<form class="am-form  am-form-horizontal dux-form"  method="post">
    <div class="am-g">
        <div class="am-u-md-4">
                <div class="am-form-group">
                    <select name="delivery_type" data-dux="form-select" required>
                        <option value="1">需要物流</option>
                        <option value="0">无需物流</option>
                    </select>
                </div>
                <div class="am-form-group">
                        <select name="name" data-dux="form-select" required>
                            <!--loop{$expressList as $vo}-->
                            <option value="{$vo.name}">{$vo.name}</option>
                            <!--{/loop}-->
                        </select>
                </div>
                <div class="am-form-group">
                    <input type="text" name="no" placeholder="请输入快递单号" required>
                </div>
                <div class="am-form-group">
                    <textarea name="remark"  placeholder="可选备注信息" rows="5"></textarea>
                </div>
                <input type="hidden" name="order_id" value="{$orderInfo.order_id}">
        </div>
        <div class="am-u-md-8">
            <div class="dux-table-auto" style="height: 330px">
                <table class="am-table dux-table-dialog">
                    <thead>
                    <tr>
                        <th width="20"><input type="checkbox" id="select-all"></th>
                        <th>商品</th>
                        <th width="50">数量</th>
                        <th width="100">小计</th>
                    </tr>
                    </thead>
                    <tbody>
                    <!--if{empty($goodsList)}-->
                    <tr>
                        <td colspan="4" class="am-text-center">暂无代发货商品</td>
                    </tr>
                    <!--{/if}-->
                    <!--loop{$goodsList as $vo}-->
                    <tr>
                        <td><input type="checkbox" name="id[]" value="{$vo.id}"></td>
                        <td>
                            <a target="_blank" href="{$vo.goods_url}">{$vo.goods_name}</a>
                            <!--if{!empty($vo.goods_options)}-->
                            <div>
                                <!--loop{$vo.goods_options as $v}-->
                                {$v.name}:{$v.value}
                                <!--{/loop}-->
                            </div>
                            <!--{/if}-->
                        </td>
                        <td>{$vo.goods_qty}</td>
                        <td class="am-text-danger">￥{$vo.price_total}</td>
                    </tr>
                    <!--{/loop}-->
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</form>
<div class="dux-dialog-foot">
    <button class="am-btn am-btn-primary" id="submit" type="button">确认发货</button>
</div>

<script>
    Do('base', function() {
        $('#select-all').change(function () {
            if($(this).prop('checked')) {
                $('table').find('input[type=checkbox]').prop('checked', true);
            } else {
                $('table').find('input[type=checkbox]').prop('checked', false);
            }

        });
        $('#submit').click(function() {
            app.ajax({
                url : '{url()}',
                type : 'post',
                data : $('form').serialize(),
                success : function(info) {
                    parent.location.reload();
                }
            });
        });
    });
</script>